Skip to content

feat: added Client.subscribe_notify_error() for error monitoring#29

Merged
petruki merged 1 commit intomasterfrom
staging
Feb 8, 2026
Merged

feat: added Client.subscribe_notify_error() for error monitoring#29
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Member

@petruki petruki commented Feb 8, 2026

This pull request introduces a mechanism to subscribe to asynchronous error notifications within the Switcher client, particularly useful for scenarios where throttle and silent mode are enabled. It also adds tests to verify that errors are properly captured and cleared when using silent mode.

Error Notification Subscription:

  • Added a subscribe_notify_error static method to the Client and ExecutionLogger classes, allowing consumers to register a callback that will be invoked when an asynchronous error occurs. This is particularly useful for handling errors in silent or throttled modes. [1] [2]
  • Implemented the _notify_error method in the Switcher class to trigger the registered error callback when exceptions are caught during remote criteria execution. [1] [2]

Testing Enhancements:

  • Updated test_switcher_silent_mode.py to register an error notification callback, assert that errors are captured when remote API calls fail, and verify that errors are cleared after silent mode expires or the API is restored. [1] [2] [3] [4]

@petruki petruki self-assigned this Feb 8, 2026
@petruki petruki added the enhancement New feature or request label Feb 8, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 2026

@petruki petruki merged commit 1456651 into master Feb 8, 2026
15 checks passed
@petruki petruki deleted the staging branch February 8, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant